% coreg_loop.m - loop through coreg subjects, computing specified
% combinations of affine transforms using specified minimization alorithm

% possible input file names (types) for coreg

% _xyz_fid
% _xyz_fid_cw6
% _xyz_fid_em6
% _xyz_fid_em3
% _xyz_fid_em9

% function coreg_loop(file_type,algo)

clear global
close all
clc

global flags

file_type='_xyz_fid_cw6';

flags.plot = 2;     % 0=none, 1=final, 2=initial & final
% Marquardt-Levenberg fails (doesn't accept bounds & too many equations...)
flags.fit = 1;      % 1=> fmincon 2=> Marquardt-Levenberg 3=>fminsearch
flags.params = 6;   % (3)=>scale, (6)=>shift&rotate, (9)=>(3)&(6)

subj=['168';'106';'169';'201';'202';'204']; % 
date=['052605';'061405';'062005';'070505';'072105';'081105'];   % 
for i_subj=6%:length(subj)
    coreged(subj(i_subj,:),date(i_subj,:),file_type)
%     pause
end